﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace ElingOA6_Admin_DSJCJ.BLL
{
    /// <summary>
    /// 工作组人员BLL
    /// </summary>
    public class HRWorkGrpMember
    {
        /// <summary>
        /// 工作组 人员DAL
        /// </summary>
        private readonly DAL.HRWorkGrpMember dal = new DAL.HRWorkGrpMember();
        /// <summary>
        /// 构造方法
        /// </summary>
        public HRWorkGrpMember()
        { }
        /// <summary>
        ///  是否存在该记录
        ///<creator>zhongyl</creator>
        /// <date>2013-07-12</date>
        /// </summary>
        /// <param name="fEntityNo">组织机构代码</param>
        /// <param name="fWorkGrpNo">工作组编号</param>
        /// <param name="fEmplNo">人员编号</param>
        /// <returns>是否存在</returns>
        public bool Exists(string fEntityNo, string fWorkGrpNo, string fEmplNo)
        {
            return dal.Exists(fEntityNo, fWorkGrpNo, fEmplNo);
        }

        /// <summary>
        /// 更新一条数据
        ///<creator>zhongyl</creator>
        /// <date>2013-07-12</date>
        /// </summary>
        /// <param name="model">工作组人员信息</param>
        public void Update(Model.HRWorkGrpMember model)
        {
            dal.Update(model);
        }

        /// <summary>
        /// 得到一个实体对象
        ///<creator>zhongyl</creator>
        /// <date>2013-07-12</date>
        /// </summary>
        /// <param name="fEntityNo">组织机构编号</param>
        /// <param name="fWorkGrpNo">工作组编号</param>
        /// <param name="fEmplNo">人员编号</param>
        /// <returns>工作组人员信息</returns>
        public Model.HRWorkGrpMember GetModel(string fEntityNo, string fWorkGrpNo, string fEmplNo)
        {

            return dal.GetModel(fEntityNo, fWorkGrpNo, fEmplNo);
        }


        /// <summary>
        /// 删除一条数据
        ///<creator>zhongyl</creator>
        /// <date>2013-07-12</date>
        /// </summary>
        /// <param name="fEntityNo">组织机构编号</param>
        /// <param name="fWorkGrpNo">工作组编号</param>
        /// <param name="fEmplNo">人员编号</param>
        public void Delete(string fEntityNo, string fWorkGrpNo, string fEmplNo)
        {

            dal.Delete(fEntityNo, fWorkGrpNo, fEmplNo);
        }

        /// <summary>
        /// 批量增加工作组职务人员（事务）
        /// </summary>
        /// <param name="members">需增加的工作组人员列表</param>
        public void Add(List<Model.HRWorkGrpMember> members)
        {
            dal.Add(members);
        }
        /// <summary>
        /// 根据公司编号从视图中获取工作组人员信息
        ///<creator>wangl</creator>
        /// <date>2013-08-10</date>
        /// </summary>
        /// <param name="entityNo">公司编号</param>
        /// <returns>DataSet对象</returns>
        public DataTable GetWorkGrpEmplNoSByView(string entityNo)
        {
            DataSet ds= dal.GetWorkGrpEmplNoSByView(entityNo);
            return ds.Tables[0];
        }
    }
}
